#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main()
{
    string n1, n2, ans; cin >> n1 >> n2;
    if(n1.size() >= n2.size()) n2.insert(0, n1.size() - n2.size(), '0');
    else n1.insert(0, n2.size() - n1.size(), '0');
    bool jug = n1 < n2;
    if(n1 < n2) swap(n1, n2);
    
    int i = n1.size(), add = 0;
    while(--i >= 0)
    {
        int cur = (n1[i] - '0') - (n2[i] - '0') + add;
        if(cur < 0) cur += 10, add = -1;
        else add = 0;
        ans += cur + '0';
    }
    
    while(ans != "0" && ans.back() == '0') ans.pop_back();
    if(jug) ans += '-';
    reverse(ans.begin(), ans.end());
    cout << ans;
    return 0;
}